<template>
  <el-row class="tac">
    <el-col>
      <el-menu
        :default-active="activepath"
        class="el-menu-vertical-demo"
        router>
        <el-menu-item index="/homePage">
          <i class="el-icon-menu"/>
          <span slot="title">订单管理</span>
        </el-menu-item>
        <el-menu-item
          v-if="userinfo.usertype=='YY'"
          index="/chufang">
          <i class="el-icon-menu"/>
          <span slot="title">处方审核</span>
        </el-menu-item>
        <el-menu-item
          v-if="userinfo.usertype=='YY'"
          index="/doctor">
          <i class="el-icon-menu"/>
          <span slot="title">医生管理</span>
        </el-menu-item>
        <el-menu-item
          v-if="userinfo.usertype=='YY'"
          index="/setting">
          <i class="el-icon-menu"/>
          <span slot="title">医院设置</span>
        </el-menu-item>
        <el-menu-item

          index="/settingdrugstore">
          <i class="el-icon-menu"/>
          <span slot="title">药店设置</span>
        </el-menu-item>
        <el-menu-item
          v-if="userinfo.usertype=='YY'"
          index="/ybjsgl">
          <i class="el-icon-menu"/>
          <span slot="title">医保结算管理</span>
        </el-menu-item>
        <el-menu-item
          index="/druglist">
          <i class="el-icon-menu"/>
          <span slot="title">药品库管理</span>
        </el-menu-item>
        <el-menu-item
          v-if="userinfo.usertype=='YY'"
          index="/duizhang">
          <i class="el-icon-menu"/>
          <span slot="title">医保对账</span>
        </el-menu-item>
      </el-menu>
    </el-col>
  </el-row>
</template>

<script>
const { config } = window
export default {
  data() {
    return {
      activepath: 'SystemHome',
      userinfo: {}
    }
  },
  mounted() {
    //alert( this.$route.path);
    this.activepath = this.$route.path
    this.userinfo = JSON.parse(localStorage.getItem(`userInfo.${config.LT}`))
  }
}
</script>

<style>
.el-menu-item.is-active {
  background: #404c5c;
  color: #fff;
  width: 200px;
}
.el-menu-item {
  background: #2a3542;
  color: #aeb2b7;
}
.el-menu-item:hover {
  background: #404c5c;
  color: #fff;
}
.tac {
  position: fixed;
  width: 200px;
}
</style>
